package myjava.switcha;

public class Root1 {

   public static void main(String[] args) {

      // char, byte, short, int, or enum sono gli unici tipi permessi per lo switch
      // the only operator available in a switch is ==
      int n = 2;

      switch (n) {
         case 1: { // you can use curly braces but they are optional
            System.out.println("this is 1");
         }
         case 2:
            System.out.println("this is 2");
         case 3:
            System.out.println("this is 3");
            break; // with no break it keeps falling through!!!
         case 4:
            System.out.println("this is 4");
      }
   }
}